const { validator } = require('../validator')

//
const createValidator = validator({
  req_id: { type: 'string', required: true, max: 32 },
  body: { type: 'string', required: true },
  level: { type: 'string', required: true },
  module: { type: 'string', required: true },
})

const getValidator = validator({
  id: { type: 'int', required: true },
})

const delValidator = validator({
  id: { type: 'int', required: true },
})

const listValidator = validator({
  pageNo: { type: 'int', required: true },
  pageSize: { type: 'int', required: true },
  // 可选参数
  // owner_id: { type: 'int', required: false },
  // module: { type: 'string', required: false },
  // level: { type: 'string', required: false },
  // startTime: { type: 'string', required: false },
  // endTime: { type: 'string', required: false },
})

module.exports = {
  getValidator,
  createValidator,
  delValidator,
  listValidator,
}
